package com.tedu;

import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.pipeline.Pipeline;

/**
 * 爬虫数据持久化
 */
public class PipelineImpl implements Pipeline {
    /**
     * 得到public void process(Page page)  方法中发送的 数据，保存到数据库
     * @param resultItems
     * @param task
     */
    public void process(ResultItems resultItems, Task task) {

        Object name = resultItems.get("title");
        System.out.println("正在进行数据持久化："+name);

    }
}
